package edu.uoc.tds.pac4.client.ss4;

import javax.swing.JPanel;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import edu.uoc.tds.pac4.common.TDSLanguageUtils;
import edu.uoc.tds.pac4.client.ss4.InterfaceFiltreInscripcions;

public class JPanelFiltreConsultaAssistencia extends JPanel {

	private static final long serialVersionUID = 1L;
	protected static final int defaultHeight = 20;		
	private JButton jButtonFiltre = null;  
	private InterfaceFiltreInscripcions pantalla = null;
	
	/**
	 * This is the default constructor
	 * @return 
	 */
	public JPanelFiltreConsultaAssistencia(InterfaceFiltreInscripcions pantalla) {
		this.pantalla = pantalla;
		initialize();
	}

	/**
	 * This method initializes this
	 * @return void
	 */
	private void initialize() {
		GridBagConstraints gbcButtonFiltre = new GridBagConstraints();
		gbcButtonFiltre.gridx = 1;
		gbcButtonFiltre.gridy = 1;
		gbcButtonFiltre.insets = new Insets(5, 10, 5, 10);
					
		// JPanel
		this.setLayout(new GridBagLayout());
		this.setName("jPanelFiltre");		
		this.add(getJButtonFiltre(), gbcButtonFiltre);		
	}

	// Getters	
	
	/**
	 * This method initializes jButtonFiltre
	 * @return javax.swing.JButton
	 */
	private JButton getJButtonFiltre() {
		if (jButtonFiltre == null) {
			jButtonFiltre = new JButton(TDSLanguageUtils.getMessage("Client.PantallaConsultaEvents.Filtrar"));
			jButtonFiltre.setSize(200, 20);
			jButtonFiltre.addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent arg0) {
					//Actualitzem taula llistat events + assistencia
					pantalla.updateTaula();					
				}
			});
		}
		return jButtonFiltre;
	}
	
}
	
	


